package name.fowler.refactoring.simplestore;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.CascadeType;
import javax.persistence.OneToMany;

@Entity
public class Customer extends BaseEntity {
	
	@OneToMany(cascade = CascadeType.ALL)
	private List<Rental> m_rental = new ArrayList<Rental>();
	private String m_Name;
	
	public Customer () {}
	
	public Customer(String name)
	{
		m_Name = name;
	}
	
	public void addRental(Rental rental)
	{
		m_rental.add(rental);
	}
	
	public void removeRental(Rental rental)
	{
		m_rental.remove(rental);
	}

	public String getM_Name() {
		return m_Name;
	}
	
	public List<Rental> getRentals()
	{
		return m_rental;
	}
}
